package com.stary.code.springboot.config.mq;

/**
 * <p>kafka配置类</p>
 * @author stary {@link stary1993@qq.com}
 * @since 2018-11-5
 */
public class KafkaConfig {

	/**
	 * 以逗号分隔的主机：端口对列表，用于建立与Kafka群集的初始连接
	 */
	private String bootstrapServers = "localhost:9092";
	/**
	 * 用于标识此使用者所属的使用者组的唯一字符串，默认my-consumer-group-id
	 */
	private String consumerGroupId = "my-consumer-group-id";
	/**
	 * 消费者自动将偏移重置为最新的偏移量，默认earliest 可选择： none，earliest，latest
	 */
	private String consumerAutoOffsetReset = "earliest";
	/**
	 * 如果为true，则消费者的偏移量将在后台定期提交，默认true
	 */
	private boolean consumerEnableAutoCommit = true;
	
	public String getBootstrapServers() {
		return bootstrapServers;
	}
	public KafkaConfig setBootstrapServers(String bootstrapServers) {
		this.bootstrapServers = bootstrapServers;
		return this;
	}
	public String getConsumerGroupId() {
		return consumerGroupId;
	}
	public KafkaConfig setConsumerGroupId(String consumerGroupId) {
		this.consumerGroupId = consumerGroupId;
		return this;
	}
	public String getConsumerAutoOffsetReset() {
		return consumerAutoOffsetReset;
	}
	public KafkaConfig setConsumerAutoOffsetReset(String consumerAutoOffsetReset) {
		this.consumerAutoOffsetReset = consumerAutoOffsetReset;
		return this;
	}
	public boolean isConsumerEnableAutoCommit() {
		return consumerEnableAutoCommit;
	}
	public KafkaConfig setConsumerEnableAutoCommit(boolean consumerEnableAutoCommit) {
		this.consumerEnableAutoCommit = consumerEnableAutoCommit;
		return this;
	}
		
}
